package com.gx.listener;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEventListener;
import org.flowable.common.engine.impl.event.FlowableEngineEventImpl;
import org.springframework.stereotype.Component;

/**
 * 流程超时提醒
 *
 * @author lpj
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class ProcessEndListener  implements FlowableEventListener {



    @Override
    public void onEvent(FlowableEvent event) {
        FlowableEngineEventImpl engineEvent = (FlowableEngineEventImpl) event;
        log.info("捕获到流程结束事件:{}",engineEvent.getProcessInstanceId());
    }


    @Override
    public boolean isFailOnException() {
        return false;
    }

    @Override
    public boolean isFireOnTransactionLifecycleEvent() {
        return false;
    }

    @Override
    public String getOnTransaction() {
        return null;
    }
}